<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>login</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link href="css/Login.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
	function login() {
		var form = document.forms[0];
		form.action = "${pageContext.request.contextPath}/user/login";
		form.method = "post";
		form.submit();
	}
	function reg() {
		var form = document.forms[0];
		form.action = "${pageContext.request.contextPath}/redirect/reg";
		form.method = "post";
		form.submit();
	}
</script>
<body>
	<div class="center jiao">
		<form name="loginForm">
			<table class="login_table">
				<tr>
					<td class="first_td">账号：</td>
					<td class="second_td"><input type="text" name="user_id"
						size="20" style="width:150px;"></td>
				</tr>
				<tr>
					<td class="first_td">密码：</td>
					<td class="second_td"><input type="password" name="password"
						size="20" style="width:150px;"></td>
				</tr>
				<tr>
					<td class="first_td">验证码：</td>
					<td class="second_td"><img border=0 height=24
						src="${pageContext.request.contextPath}/jsp/code.jsp" /><input
						class="codeinput" type="text" maxlength="4" name="code" size="4"
						style="width:78px;" /></td>
				</tr>
				<tr>
					<td style="text-align:right;"><input class="but_login"
						type="button" value="登录" onclick="login()"></td>
					<td style="text-align:center;"><input class="but_reg"
						type="button" value="注册" onclick="reg()"></td>
				</tr>
				<tr>
					<td></td>
					<td>
						<%
							String message = (String) session.getAttribute("msg");
							if ("failed".equals(message)) {
								out.print("账号或密码错误!");
							} else if ("codeWrong".equals(message)) {
								out.print("验证码错误!");
							}
						%>
					</td>
				</tr>
			</table>
		</form>
	</div>
	<%@include file="footer.html"%>
</body>
</html>
